#!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: muchen
@file: user_center.py
@time: 2025/01/06
"""

import requests
from autoTest_BrtcApi.core.usercenter_apiUtils import api_util

# 初始化 requests.sessions()对象
req = requests.session()
# url前缀
root_url = 'http://10.10.10.192:8899'


# 和用户相关的API
class UserApi():

    # 注册api
    def register(self, username, passwd, phone):
        # 注册
        filename = '/register'
        # 请求头:
        headers = {
            "Content-Type": "application/json",
            "Accept": "application/json"
        }

        # 请求参数：user_name, passwd, phone
        data = {
            "user_name": username,
            "passwd": passwd,
            "phone": phone
        }
        # 发送请求
        return api_util.register_api(filename, headers, json=data)


# 实例化UserApi()
user_api = UserApi()
